import { createRouter, createWebHashHistory, RouteRecordRaw } from "vue-router";
const routes: Array<RouteRecordRaw> = [
	{
	  path: "/login",
	  name: "webTeamLogin",
	  redirect:"/login",
	  component: () => import("../views/webTeamLogin.vue"),
		children:[{
			path: "/login",
			name: "login",
			component: () => import("../views/login.vue"),
			meta: {
				name: '',
				requireAuth: false, // 添加该字段，表示进入这个路由是需要登录的
			},
		},{
			path: "/register",
			name: "register",
			component: () => import("../views/register.vue"),
			meta: {
				name: '',
				requireAuth: false,
			},
		},{
			path: "/forgetIndex",
			name: "forgetIndex",
			component: () => import("../views/forget.vue"),
			meta: {
				name: '',
				requireAuth: false,
			},
		},{
			path: "/webRTC",
			name: "webRTC",
			component: () => import("../views/webRTC/webRTC.vue"),
			meta: {
				name: '',
				requireAuth: true,
			},
		}]
	},
	
	{
		path: "/",
		name: "webTeam",
		redirect:"/community",
		component: () => import("../views/webTeam.vue"),
		children:[{
			path: "/community",
			name: "community",
			component: () => import("../views/children/community.vue"),
		},{
			path: "/interpolate",
			name: "interpolate",
			component: () => import("../views/children/interpolate.vue"),
		},{
			path: "/gameList",
			name: "gameList",
			component: () => import("../views/children/gameList.vue"),
		},{
			path: "/sourceList",
			name: "sourceList",
			component: () => import("../views/children/sourceList.vue"),
		},{
			path: "/chat",
			name: "chat",
			component: () => import("../views/children/chat.vue"),
		},{
			path: "/communityDetail",
			name: "communityDetail",
			component: () => import("../views/community/communityDetail.vue"),
		},{
			path: "/communityPublic",
			name: "communityPublic",
			component: () => import("../views/community/communityPublic.vue"),
		},{
			path: "/communityUpdate",
			name: "communityUpdate",
			component: () => import("../views/community/communityUpdate.vue"),
		},{
			path: "/public",
			name: "public",
			component: () => import("../views/my/my-public.vue"),
		},{
			path: "/star",
			name: "star",
			component: () => import("../views/my/my-star.vue"),
		},{
			path: "/news",
			name: "news",
			component: () => import("../views/my/my-news.vue"),
		},{
			path: "/set",
			name: "set",
			component: () => import("../views/my/my-set.vue"),
		},{
			path: "/revise",
			name: "revise",
			component: () => import("../views/my/my-revise.vue"),
		},{
			path: "/forget",
			name: "forget",
			component: () => import("../views/my/my-forget.vue"),
		},{
			path: "/push",
			name: "push",
			component: () => import("../views/my/my-push.vue"),
		},{
			path: "/userManage",
			name: "userManage",
			component: () => import("../views/manage/userManage.vue"),
		},{
			path: "/articleReview",
			name: "articleReview",
			component: () => import("../views/manage/articleReview.vue"),
		},{
			path: "/gobang",
			name: "gobang",
			component: () => import("../views/game/gobang.vue"),
		},{
			path: "/gobangRecord",
			name: "gobangRecord",
			component: () => import("../views/game/gobangRecord.vue"),
		},{
			path: "/puzzle",
			name: "puzzle",
			component: () => import("../views/puzzleGame/puzzle.vue"),
		},{
			path: "/matchGame",
			name: "matchGame",
			component: () => import("../views/matchGame/matchGame.vue"),
		},{
			path: "/landlord",
			name: "landlord",
			component: () => import("../views/landlordGame/landlord.vue"),
		},{
			path: "/questionList",
			name: "questionList",
			component: () => import("../views/manage/questionList.vue"),
		},{
			path: "/pageArrange",
			name: "pageArrange",
			component: () => import("../views/my/my-page.vue"),
		}]
	},
];

const router = createRouter({
  history: createWebHashHistory(),
  routes,
});

export default router;
